Feat: create lsl reader and config parser - #30
Merged
Conversation
Closed
M1KUS3Q
reviewed
Jul 20, 2026
M1KUS3Q
reviewed
Jul 20, 2026
M1KUS3Q
reviewed
Jul 20, 2026
Contributor
|
The config boundary between what stays in protobuf files and what goes in via JSON is never documented. This should be established early to avoid later config refactoring. |
M1KUS3Q
reviewed
Jul 20, 2026
M1KUS3Q
reviewed
Jul 20, 2026
M1KUS3Q
reviewed
Jul 20, 2026
M1KUS3Q
reviewed
Jul 20, 2026
M1KUS3Q
approved these changes
Jul 21, 2026
M1KUS3Q
left a comment
Contributor
There was a problem hiding this comment.
Left stuff to think about in comments, otherwise lgtm
- rename ExperimentConfig to DeviceConfig: it describes the acquisition hardware, not the experiment, which lives in the protobuf files - move `channels` to the top level of DeviceConfig so the struct mirrors config.json 1:1, like every other field already does - LSLReader: create the inlet with liblsl's recover flag off and catch lsl::lost_error to re-resolve and re-validate a dropped stream, as README §6 already claimed. With recover on, lost_error is never thrown, so the documented behaviour could not have held - LSLReader: take a DeviceConfig and forward only the channels the config enables, in declaration order; reject a config that enables none - ConfigParser: validate config_version (MAJOR.MINOR) before any other field, rejecting an unsupported major and unparseable versions - README: document the protobuf/JSON config boundary and the schema versioning rules (§5) Note: I decided to leave all static classes as they are, and created a seperate issue to refactor them into namespaces
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Here is an example of config.json file
{ "config_version": "1.0", "device_name": "OpenBCI Cyton 8ch", "montage_standard": "10-20", "lsl_stream": { "name": "obci_eeg1", "type": "EEG", "source_id": "cyton-a1b2c3", "expected_channel_count": 8, "expected_sample_rate_hz": 250 }, "reference": { "label": "linked_mastoids", "scheme": "physical" }, "ground": { "label": "Fpz" }, "channels": [ { "index": 0, "label": "Fz", "enabled": true, "unit": "microvolts" }, { "index": 1, "label": "Cz", "enabled": true, "unit": "microvolts" }, { "index": 2, "label": "Pz", "enabled": true, "unit": "microvolts" }, { "index": 3, "label": "Oz", "enabled": true, "unit": "microvolts" }, { "index": 4, "label": "P3", "enabled": true, "unit": "microvolts" }, { "index": 5, "label": "P4", "enabled": true, "unit": "microvolts" }, { "index": 6, "label": "O1", "enabled": true, "unit": "microvolts" }, { "index": 7, "label": "O2", "enabled": false, "unit": "microvolts" } ], "impedance_check": { "supported": true, "threshold_kohm": 5.0 } }